﻿<UserControl
    x:Class="DvachBrowser3.Views.Partial.ProgressIndicatorControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:DvachBrowser3.Views.Partial"
    xmlns:local2="using:DvachBrowser3"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300"
    d:DesignWidth="400">
    
    <UserControl.Resources>
        <local2:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
    </UserControl.Resources>

    <Grid Visibility="{x:Bind IsVisible, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter=false}">
        <Border Padding="4" Margin="4">
            <StackPanel>
                <ProgressBar IsIndeterminate="{x:Bind IsIndeterminate, Mode=OneWay}" Minimum="0" Maximum="100" Margin="2" Value="{x:Bind Progress, Mode=OneWay}" />
                <TextBlock TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Visibility="{x:Bind IsShowMessage, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter=false}"
                   Text="{x:Bind Message, Mode=OneWay}" FontSize="{x:Bind ViewModel.StyleManager.Text.PostFontSize, Mode=OneWay}" Margin="2"/>
            </StackPanel>
        </Border>
    </Grid>
</UserControl>
